import { create } from "zustand";

interface GameState {
  health: number;
  inventory: string[];
  currentLocation: "town" | "dungeon";
  reputation: number;

  // Actions
  takeDamage: (amount: number) => void;
  addItem: (item: string) => void;
}

export const useGameStore = create<GameState>(set => ({
  health: 100,
  inventory: [],
  currentLocation: "town",
  reputation: 0,

  takeDamage: amount => set(state => ({ health: state.health - amount })),
  addItem: item => set(state => ({ inventory: [...state.inventory, item] }))
}));
